using System.Collections;
using UnityEngine;

public class ButShowLeadersManager : MonoBehaviour
{
	private GameObject _panelLeaderBoard;

	private void OnClick()
	{
		StartCoroutine(LoadingLeadersManager());
	}

	private IEnumerator LoadingLeadersManager()
	{
		if (_panelLeaderBoard == null)
		{
			LoadingPanel.instance.ShowLoadingPanel(true);
			ResourceRequest leader = Resources.LoadAsync("Prefabs/Lobby/PanelLeaderBoard");
			yield return leader;
			_panelLeaderBoard = Object.Instantiate(leader.asset as GameObject);
			_panelLeaderBoard.transform.parent = controllerMenu.thisScript.parentLobbyUI.transform;
			_panelLeaderBoard.transform.localScale = Vector3.one;
			LoadingPanel.instance.ShowLoadingPanel(false);
		}
		_panelLeaderBoard.SetActive(true);
	}
}
